package com.doublethread.easymart.common.exception;

import com.doublethread.easymart.common.result.ResultCode;

/**
 * 评论模块异常工具类
 */
public class CommentException {

    /**
     * 评论不存在异常
     */
    public static void commentNotFound() {
        throw new BusinessException(ResultCode.COMMENT_NOT_FOUND);
    }

    /**
     * 无权限评论异常
     */
    public static void commentNotAllowed() {
        throw new BusinessException(ResultCode.COMMENT_NOT_ALLOWED);
    }

    /**
     * 重复评论异常
     */
    public static void commentAlreadyExists() {
        throw new BusinessException(ResultCode.COMMENT_ALREADY_EXISTS);
    }

    /**
     * 商品不存在无法评论异常
     */
    public static void commentProductNotFound() {
        throw new BusinessException(ResultCode.COMMENT_PRODUCT_NOT_FOUND);
    }
}